On aspectualizing component models
نویسندگان
چکیده
aspect RoleBasedAuthorization { protected AuthorizationService as = ...; abstract pointcut authorizedMethods(); protected before() : authorizedMethods() { //authorization check implementation goes here } } aspect OrderProductAuthorization extends RoleBasedAuthorization { pointcut authorizedMethods() : call(public void Order.*) || call(public * Product.*}; } Figure 9. Aspect Reuse via Abstract Aspects To apply authorization checks to Order and Product in Fig. 9, we don’t change RoleBasedAuthorization but implement the pointcut of OrderProductAuthorization instead. The pointcut now also denotes those points in the execution of the program when instances of the Product class receive messages in addition to the points when instances of Order receive messages. OrderProductAuthorization thus fulfills a similar role as a binding in [12, 13]. Employing abstract aspects to increase aspect reusability in AspectJ has the following drawbacks: First, using concrete aspects as connectors may easily lead to a complex and bloated aspect hierarchy, which is hard to understand, extend and maintain. Second, when we employ an abstract aspect, it is still necessary to have the aspect source code available as well as being able to understand and modify AspectJ code in order to apply an authorization service to base objects. As pointed out in [13] and [5], the process of binding an abstract aspect to a concrete base object via inheritance requires sophisticated programming skills and is by no means straightforward. Third, applying abstract aspects is limited especially if aspects define aspect instance state, as discussed in detail in [13] and [5]. EJB technology makes it certainly much easier to apply infrastructural services to an Enterprise JavaBean. If Order and Product were EJBs, we would just deploy the two EJBs together with their deployment descriptor. The container would then automatically apply the appropriate services. To modify authorization checks, we simply edit the deployment descriptor. There is no need to programmatically change any container or EJB code. In fact the container’s interceptor framework is neither specified by the EJB specification [16] nor is the source code of any commercial EJB container available (see Sec. 2.1 for discussion). 3.3.2. Deploying Aspects AspectJ requires that aspects are applied to base objects at design time (base object classes are hard coded in pointcuts and aspects are compiled together with the base object code). As a consequence, the application of infrastructural services to classes like Order and Product Copyright c © 2000 John Wiley & Sons, Ltd. Softw. Pract. Exper. 2000; 00:1–6 Prepared using speauth.cls 14 R. PICHLER K. OSTERMANN M. MEZINI cannot be changed at deployment time. Using EJBs, however, infrastructural services are applied at deployment time via the deployment descriptor. Some J2EE application servers even allow deployment descriptor changes in production (hot deployment). Delaying the application of infrastructural services until deployment time increases the flexibility and reusability significantly. Besides the useful delay of the deployment to runtime, this also enables to choose the actual implementation of an aspect at runtime, i.e., we could choose the transactionor persistence implementation at runtime. In AspectJ, however, there exists a static link between a particular aspect implementation and the base classes, and we have no means whatsoever to change this link without modifying code (which is bad), and even if we come to terms with code modification, this cannot be done after compile time.
منابع مشابه
Prediction of mental disorders after Mild Traumatic Brain Injury: principle component Approach
Introduction: In Processes Modeling, when there is relatively a high correlation between covariates, multicollinearity is created, and it leads to reduction in model's efficiency. In this study, by using principle component analysis, modification of the effect of multicolinearity in Artificial Neural Network (ANN) and Logistic Regression (LR) has been studied. Also, the effect of multicolineari...
متن کاملSparse Structured Principal Component Analysis and Model Learning for Classification and Quality Detection of Rice Grains
In scientific and commercial fields associated with modern agriculture, the categorization of different rice types and determination of its quality is very important. Various image processing algorithms are applied in recent years to detect different agricultural products. The problem of rice classification and quality detection in this paper is presented based on model learning concepts includ...
متن کاملFads Models with Markov Switching Hetroskedasticity: decomposing Tehran Stock Exchange return into Permanent and Transitory Components
Stochastic behavior of stock returns is very important for investors and policy makers in the stock market. In this paper, the stochastic behavior of the return index of Tehran Stock Exchange (TEDPIX) is examined using unobserved component Markov switching model (UC-MS) for the 3/27/2010 until 8/3/2015 period. In this model, stock returns are decomposed into two components; a permanent componen...
متن کاملA comparative study of Cu(П) and Pb(П) adsorption by Iranian bentonite (Birjand area) in aqueous solutions
Heavy metals such as Cu(II) and Pb(II) are among the hazardous pollutants that lead to severe ecological problems and have a toxic effect on living organisms. The removal of Cu(II) and Pb(II) by Iranian bentonite experiment were conducted in single component and multi component systems. The bentonite from the Birjand area was characterized by X-ray diffraction pattern and FTIR spectroscopy. The...
متن کاملThe Effect of Vertical Component of Earthquake on Continuous and Monolithic Frame Bridges
Performance of structures during recent earthquakes shows that the effect of vertical component of earthquake (VCE) could be considered as one of the main causes of bridges collapse. In most of bridge design codes, for seismic analysis of bridges, VCE is not taken into account or a distinguished method isn’t presented for assessment of VCE. In the present work, the effect of VCE on two existing...
متن کاملDesign and construction of 6-component balance dynamometer for measurement of the forces, moments andmotions of ship models in the towing tank
During design spiral of a merchant ship or a naval vessel, it is important to perform towing tank tests in order to measure its performance either in calm water maneuvers or in waves for seakeeping performance. Also, to optimize a hydrodynamic design, towing tank tests are advantageous.This article presents the results of an applied research project. The objective of this project is to design a...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- Softw., Pract. Exper.
دوره 33 شماره
صفحات -
تاریخ انتشار 2003